Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce DescribeReplication #4904

Merged
merged 1 commit into from
May 28, 2024

Conversation

CyberROFL
Copy link
Member

@CyberROFL CyberROFL commented May 27, 2024

Changelog entry

...

Changelog category

  • Not for changelog (changelog entry is not required)

Additional information

...

@CyberROFL CyberROFL requested a review from Enjection May 27, 2024 18:43
@CyberROFL CyberROFL self-assigned this May 27, 2024
@CyberROFL CyberROFL marked this pull request as ready for review May 27, 2024 18:43
Copy link

github-actions bot commented May 27, 2024

2024-05-27 18:44:22 UTC Pre-commit check for 3178f64 has started.
2024-05-27 18:46:59 UTC Check cancelled

Copy link

github-actions bot commented May 27, 2024

2024-05-27 18:46:22 UTC Pre-commit check for 3178f64 has started.
2024-05-27 18:47:09 UTC Check cancelled

Copy link

github-actions bot commented May 27, 2024

2024-05-27 18:46:33 UTC Pre-commit check for 3178f64 has started.
2024-05-27 18:47:09 UTC Check cancelled

@CyberROFL CyberROFL force-pushed the describe-replication branch from 522071d to 51eea7b Compare May 27, 2024 18:46
Copy link

github-actions bot commented May 27, 2024

2024-05-27 18:50:16 UTC Pre-commit check for 1d29229 has started.
2024-05-27 18:51:53 UTC Check cancelled

Copy link

github-actions bot commented May 27, 2024

2024-05-27 18:50:16 UTC Pre-commit check for 1d29229 has started.
2024-05-27 18:51:53 UTC Check cancelled

Copy link

github-actions bot commented May 27, 2024

2024-05-27 18:50:56 UTC Pre-commit check for 1d29229 has started.
2024-05-27 18:51:53 UTC Check cancelled

@CyberROFL CyberROFL force-pushed the describe-replication branch from 51eea7b to ba161eb Compare May 27, 2024 18:51
Copy link

github-actions bot commented May 27, 2024

2024-05-27 18:53:07 UTC Pre-commit check for 21b31c4 has started.
2024-05-27 18:55:04 UTC Check cancelled

Copy link

github-actions bot commented May 27, 2024

2024-05-27 18:54:30 UTC Pre-commit check for 21b31c4 has started.
2024-05-27 18:55:04 UTC Check cancelled

@CyberROFL CyberROFL force-pushed the describe-replication branch from ba161eb to 5c6d0c2 Compare May 27, 2024 18:54
Copy link

github-actions bot commented May 27, 2024

2024-05-27 18:56:24 UTC Pre-commit check for fd0f183 has started.
2024-05-27 18:59:20 UTC Build linux-x86_64-release-clang14 is running...
🔴 2024-05-27 19:38:31 UTC Build failed. see the build logs.

Copy link

github-actions bot commented May 27, 2024

2024-05-27 18:57:37 UTC Pre-commit check for fd0f183 has started.
2024-05-27 19:00:40 UTC Build linux-x86_64-release-asan is running...
🟢 2024-05-27 19:45:14 UTC Build successful.
2024-05-27 19:45:28 UTC Tests are running...
🔴 2024-05-27 21:54:58 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
15219 15073 0 65 64 17

Copy link

github-actions bot commented May 27, 2024

2024-05-27 18:58:40 UTC Pre-commit check for fd0f183 has started.
2024-05-27 19:01:35 UTC Build linux-x86_64-relwithdebinfo is running...
🟢 2024-05-27 19:42:21 UTC Build successful.
2024-05-27 19:42:37 UTC Tests are running...
🔴 2024-05-27 21:37:34 UTC Some tests failed, follow the links below.

Test history

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
74337 61622 0 4 12703 8

Copy link
Member

@Enjection Enjection left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Все коменты минорные в целом ОК

Comment on lines +55 to +90
void Handle(NSchemeShard::TEvSchemeShard::TEvDescribeSchemeResult::TPtr& ev, const TActorContext& ctx) {
const auto& record = ev->Get()->GetRecord();
const auto& desc = record.GetPathDescription();

if (record.HasReason()) {
auto issue = NYql::TIssue(record.GetReason());
Request_->RaiseIssue(issue);
}

switch (record.GetStatus()) {
case NKikimrScheme::StatusSuccess:
if (desc.GetSelf().GetPathType() != NKikimrSchemeOp::EPathTypeReplication) {
auto issue = NYql::TIssue("Is not a replication");
Request_->RaiseIssue(issue);
return Reply(Ydb::StatusIds::SCHEME_ERROR, ctx);
}

ConvertDirectoryEntry(desc.GetSelf(), Result.mutable_self(), true);
return DescribeReplication(desc.GetReplicationDescription().GetControllerId(),
PathIdFromPathId(desc.GetReplicationDescription().GetPathId()));

case NKikimrScheme::StatusPathDoesNotExist:
case NKikimrScheme::StatusSchemeError:
return Reply(Ydb::StatusIds::SCHEME_ERROR, ctx);

case NKikimrScheme::StatusAccessDenied:
return Reply(Ydb::StatusIds::UNAUTHORIZED, ctx);

case NKikimrScheme::StatusNotAvailable:
return Reply(Ydb::StatusIds::UNAVAILABLE, ctx);

default: {
return Reply(Ydb::StatusIds::GENERIC_ERROR, ctx);
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Выглядит так, что мы таскаем эту копипасту из функции в функцию, в данном ревью не критично, но стоит обобщить.

Comment on lines +177 to +178
default:
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. default скроет ошибку компилятора при добавлении нового кейса
  2. отсутствует логирование на неизвестный кейс.

@CyberROFL CyberROFL merged commit 3cc510d into ydb-platform:main May 28, 2024
6 of 12 checks passed
@CyberROFL CyberROFL deleted the describe-replication branch May 28, 2024 09:31
@niksaveliev niksaveliev mentioned this pull request May 29, 2024
@StekPerepolnen StekPerepolnen mentioned this pull request May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants